{% extends "./admin/layout.html" %}
{% block title %}友情链接{% endblock %}
{% block head %}
    {{ super() }}
{% endblock %}
{% block content %}
    <div class="row" style="margin: 100px 200px 0px 200px;">
        <div class="col-md-5">
            {% block nav %}
                {{ super() }}
            {% endblock %}
        </div>
        <div class="col-md-7">
            <form action="{{ url_for('.admin_youlian') }}" method="post">
                <div class="input-group">
                    <span class="input-group-addon">网站名称</span>
                    <input type="text" name="title" class="form-control" placeholder="网站">
                </div>
                <div class="input-group">
                    <span class="input-group-addon">网   址</span>
                    <input type="text" name="url" class="form-control" placeholder="http://">
                </div>
                <input class="btn btn-primary" type="submit" value="提交">
            </form>
        <br>
            {% if data.youlian %}
                <table class="table">
                <thead>
                <tr>
                    <th>网站名称</th>
                    <th>网址</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for yl in data.youlian %}
                    <tr>
                        <td>{{ yl.title }}</td>
                        <td>{{ yl.url }}</td>
                        <td><a href="{{ url_for('.youlian_del',id = yl.id) }}">删除</a></td>
                    </tr>
                {% endfor %}
                </tbody>
            {% else %}
                none
            {% endif %}
        </div>
    </div>
{% endblock %}